package com.reisen;

import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
import org.jasypt.encryption.pbe.config.EnvironmentPBEConfig;

public class PasswordEncrypt {

    public static void main(String[] args) {
	// write your code here
    StandardPBEStringEncryptor standardPBEStringEncryptor = new StandardPBEStringEncryptor();
    EnvironmentPBEConfig config = new EnvironmentPBEConfig();

    config.setAlgorithm("PBEWithMD5AndDES");          // 加密的算法，这个算法是默认的
    config.setPassword("sigtuna");                        // 加密的密钥，随便自己填写，很重要千万不要告诉别人
    standardPBEStringEncryptor.setConfig(config);
    String url = "jdbc:mysql://:3306/travel5?characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=GMT";         //自己的密码
    String root = "travel5";         //自己的密码
    String pwd = "RXyfCNzbi4dnAmjP";         //自己的密码

    System.out.println("url "+ standardPBEStringEncryptor.encrypt(url));
    System.out.println("root "+ standardPBEStringEncryptor.encrypt(root));
    System.out.println("pwd "+ standardPBEStringEncryptor.encrypt(pwd));
    }

}
